using System;
using System.Collections.Generic;
using System.Text;

namespace Instedd.Labs.Forms.Library
{
    public class Area
    {
        private string name;
        private Polygon polygon;
        private List<Survey> surveys = new List<Survey>();

        public Area(string name, Polygon polygon)
        {
            this.name = name;
            this.polygon = polygon;
        }

        public List<Survey> Surveys
        {
            get { return surveys; }
            set { surveys = value; }
        }

        public Polygon Polygon
        {
            get { return polygon; }
            set { polygon = value; }        
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public void Aggregate()
        {
            foreach (Survey survey in surveys)
            {
                this.totalDeceased += survey.TotalDeceased;
                this.totalExposed += survey.TotalExposed;
                this.totalExposedAndIll += survey.TotalExposedAndIll;
                this.totalExposedNotIll += survey.TotalExposedNotIll;
                this.totalReceivedTreatment += survey.TotalReceivedTreatment;
                this.totalRecovered += survey.TotalRecovered;
                this.totalWell += survey.TotalWell;
                this.totalAllergicOccupantsToCiproOrDoxy += survey.AllergicDoxy;
                this.totalCiproDistributed += survey.CiproDistributed;
                this.totalDoxyDistributed += survey.DoxyDistributed;
            }
        }

        private int totalWell;

        public int TotalWell
        {
            get
            {
                return totalWell;
            }
        }

        private int totalExposed;

        public int TotalExposed
        {
            get { return totalExposed; }
            set { totalExposed = value; }
        }

        private int totalExposedNotIll;

        public int TotalExposedNotIll
        {
            get { return totalExposedNotIll; }
            set { totalExposedNotIll = value; }
        }

        private int totalExposedAndIll;

        public int TotalExposedAndIll
        {
            get { return totalExposedAndIll; }
            set { totalExposedAndIll = value; }
        }


        private int totalReceivedTreatment;

        public int TotalReceivedTreatment
        {
            get { return totalReceivedTreatment; }
            set { totalReceivedTreatment = value; }
        }

        private int totalRecovered;

        public int TotalRecovered
        {
            get { return totalRecovered; }
            set { totalRecovered = value; }
        }

        private int totalDeceased;

        public int TotalDeceased
        {
            get { return totalDeceased; }
            set { totalDeceased = value; }
        }

        private int totalCiproDistributed;

        public int TotalCiproDistributed
        {
            get { return totalCiproDistributed; }
            set { totalCiproDistributed = value; }
        }

        private int totalDoxyDistributed;

        public int TotalDoxyDistributed
        {
            get { return totalDoxyDistributed; }
            set { totalDoxyDistributed = value; }
        }

        private int totalAllergicOccupantsToCiproOrDoxy;

        public int TotalAllergicOccupantsToCiproOrDoxy
        {
            get { return totalAllergicOccupantsToCiproOrDoxy; }
            set { totalAllergicOccupantsToCiproOrDoxy = value; }
        }

        public int TotalSurveys
        {
            get
            {
                return surveys.Count;
            }
        }
    }
}
